#include "Timer.h"

Timer::Timer()
{
    loop_time = 0;
}

void Timer::start()
{
    gettimeofday( &before_time, NULL );
}

float Timer::stop()
{
    gettimeofday( &after_time, NULL );
    loop_time = (after_time.tv_sec - before_time.tv_sec)*1000.0 + (after_time.tv_usec - before_time.tv_usec)*1.0/1000.0;
    return loop_time;
}

